<template>
  <el-container>
    <el-aside width="200px">
      <left-comments @doctor-selected="handleDoctorSelection" style="width: 200px;"></left-comments>
    </el-aside>
    <el-main>
      <right-comments :selected-doctor-id="currentDoctorId"></right-comments>
    </el-main>
  </el-container>
</template>

<script>
import LeftComments from '../../components/Comments/LeftComments.vue';
import RightComments from '../../components/Comments/RightComments.vue';
export default {
  components: {
    LeftComments,
    RightComments
  },
  data() {
    return {
      currentDoctorId: null
    }
  },
  methods:{
    //发送给子组件
    handleDoctorSelection(doctorId) {
      this.currentDoctorId = doctorId;
      console.log('父组件接收到医生ID:', doctorId);
    }
  }
}
</script>

<style>
 .el-header {
    background-color: #B3C0D1;
    color: #333;
    line-height: 60px;
  }

.el-aside {
    background-color: #D3DCE6;
    color: #333;
    height: 100vh;
}

.el-main {
    background-color: #E9EEF3;
    color: #333;
}

body>.el-container {
    margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
    line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
    line-height: 320px;
}
</style>